import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from "@/utils/request"
Vue.config.productionTip = false
import { Button, Icon, Field, Divider, Toast, Cell, CellGroup, NavBar, Image as VanImage, ActionSheet, Search, Uploader, Dialog, Tab, Tabs, PullRefresh, List, ShareSheet, Tabbar, TabbarItem, SwipeCell, DropdownMenu, DropdownItem, Grid, GridItem } from 'vant';
Vue.use(Button);
Vue.use(Icon);
Vue.use(Field);
Vue.use(Divider);
Vue.use(Toast);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
Vue.use(VanImage);
Vue.use(ActionSheet);
Vue.use(Search);
Vue.use(Uploader);
Vue.use(Dialog);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(PullRefresh);
Vue.use(List);
Vue.use(ShareSheet);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(SwipeCell);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Grid);
Vue.use(GridItem);
//时间格式化
Vue.filter("printfTime", (val) => {
  return val.toLocaleDateString()
})
//路径拼接
Vue.filter("joinPath", (val) => {
  if (!val) return val
  if (val.indexOf("http") != -1) {
    return val
  } else {
    return axios.defaults.baseURL + val
  }
})
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
